<?php
include("controler/Conexao.php");

$conexao = new Conexao();

$con = $conexao->conectBD();


$sql = "SELECT * FROM categoria";


$result = pg_query($sql);


?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <LINK REL=StyleSheet HREF="main.css" TYPE="text/css" MEDIA=screen>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>   
    <link rel="stylesheet" href="main.css" />
    </head>
    <body>
        <table border="0" width="100%" align="center" style="border: 1px solid #ccc;">
            <thead>
                <tr align="center" style="border: 1px solid #ccc;">
                    <td align="center" ><strong>Categoria</strong></td>
                    <td align="center" colspan="3"> <strong>Acao</strong></td>
                </tr>
            </thead>
            <tbody>
                <?php while ($colum = pg_fetch_array($result)) { ?>  
                <tr style="border: 1px solid #ccc;">
                    <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["nome"]; ?>  
                    </td>
                    
                    <td align="center" width="20" style="border: 1px solid #ccc;"><a href="indexAdmin.php?link=2&AMP;id= <?php echo $colum["id"] ?>"><img src="images/icon_lupa.png" width="15" height="15" alt="icon_lupa"/></a></td>
                    <td align="center" width="20" style="border: 1px solid #ccc;"><a href="#"><img src="images/edit-icon.png" width="15" height="15" alt="edit-icon"/></a></td>
                    <td align="center" width="20" style="border: 1px solid #ccc;"><a href="#"><img src="images/cancel_48.png" width="15" height="15" alt="cancel_48"/></a></td>
                </tr>
                 <?php } $conexao->desconectBD(); ?>
                <tr>
                    <td></td>
                    <td colspan="3" align="right"><a href="#"> INSERIR <img src="images/add_48.png" width="20" height="20" alt="add_48"/> </a></td>
                    
                </tr>
            </tbody>
           
            
        </table>
        
    </body>
    
</html>